package com.ellricky.baselib.ui.visit

import android.os.Bundle
import android.view.View
import com.andr.common.ui.fragment.BaseFragment
import com.andr.common.ui.fragment.BaseToolBarFragment
import com.andr.common.ui.mvp.BasePresenter
import com.andr.common.util.ResUtil
import com.ellricky.baselib.BaseConstant
import com.ellricky.baselib.R
import kotlinx.android.synthetic.main.base_fragment_visit.*

class VisitFragment : BaseToolBarFragment<Void, BasePresenter<Void>>() {

    companion object {
        fun newInstance(bundle: Bundle? = null): VisitFragment {
            val fragment = VisitFragment()
            fragment.arguments = bundle
            return fragment
        }
    }

    override fun getContentLayout(): Int {
        return R.layout.base_fragment_visit
    }

    override fun initUIView(p0: View?) {
        super.initUIView(p0)

        mTvTitle.text = ResUtil.getStr(context, R.string.base_visit_list_2)

        val tList = ResUtil.getStrArr(context, R.array.Visit).toList()

        val frgList = listOf(
            VisitChildFragment.newInstance("0"), //首课
            VisitChildFragment.newInstance("1"),//第一次回访
            VisitChildFragment.newInstance("2"),//第二次回访
            VisitChildFragment.newInstance("3"),//第三次回访
            VisitChildFragment.newInstance("4"),//第四次回访
            VisitChildFragment.newInstance("5"),//第五次回访
            VisitChildFragment.newInstance("6"),//第六次回访
            VisitChildFragment.newInstance("7"),//第七次回访
            VisitChildFragment.newInstance("8"),//第·八次回访
            VisitChildFragment.newInstance("9"),//第九次回访
            VisitChildFragment.newInstance("10"),//第十次回访
        )

        tabLayout.setUp(childFragmentManager, frgList, tList, vp)

        if (arguments != null) {
            mToolbar.visibility = View.GONE
        }
    }
}